<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

/*Route::get('/', function () {
    return view('welcome');
});*/
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::get("/demo",['uses'=>"StudentController@demo"]);

Route::group(['prefix' => 'demo'],function (){
    //获取用户信息
    Route::post("/getinfo","TestController@Getinfo");
});

Route::get("student/index",['uses'=>"StudentController@index"]);


Route::group(['middleware' => ['web']], function () {
    //
    Route::get('/', function ()    {
        return view('greeting', ['name' => 'James']);
    });

    Route::group(['prefix' => 'test'],function (){
        //设置session
        Route::get("/setSession","TestController@SetSession");
        //获取session
        Route::get("/getSession","TestController@GetSession");
    });
});
